<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>扩展运算实践2</title>
</head>
<body>
  <script>
    const arr1 = [1, 2, 3];
    const arr2 = [4, 5];
    // [1, 2, 3, 4, 5]
    // 方案1
    console.log(arr1.concat(arr2));
    // 方案2
    console.log([...arr1, ...arr2]);
    // 方案3 使用apply继承方式
    arr1.push.apply(arr1, arr2)
    console.log(arr1);

    const date = [2019, 09, 09];
    console.log(new Date(...date))
  </script>
</body>
</html>